//
//  WmcStringEx.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/1.
//

import UIKit


extension String {
    /// 转换成图片，兼容Bundle
    var wmc_image: UIImage {
        return yp.uiImage(bundle: .WmcBundle)
    }
    
    func wmc_image(tintColor: YPUnifiedColor?) -> UIImage {
        return yp.uiImage(bundle: .WmcBundle, tintColor: tintColor)
    }
    
    /// json字符串转json对象
    var wmc_jsonObj: Any? {
        guard let data = data(using: .utf8) else { return nil }
        let obj = try? JSONSerialization.jsonObject(with: data, options: .mutableContainers)
        return obj
    }
}

